/*
 * @Author: OreoWang
 * @Email: ihc523@163.com
 * @Date: 2020-06-01 17:19:57
 * @LastEditors: OreoWang
 * @LastEditTime: 2022-08-08 14:13:16
 * @Description: 视图属性基类
 */

import { _decorator, Component } from "cc";
import { logger } from "./ViewLogger";
const { ccclass, disallowMultiple } = _decorator;
import { TypeProperty, _access } from "./ViewAccess";
export { _access as access };

/**
 * 视图属性基类
 */
@ccclass("ViewNode")
@disallowMultiple
export default class ViewNode extends Component {
    protected __autoProperty__: Map<string, TypeProperty> = new Map();

    constructor() {
        super();
    }
    
    onLoad(){
        // logger.log("property onLoad: ", this.__autoProperty__);
    }

    onDestroy(){
        // logger.log("property onDestroy: ", this.__autoProperty__);
        this._clearProperty();
    }

    protected _clearProperty(){
        this.__autoProperty__.clear();
    }
}
